package model

import (
	"github.com/jjl309/oneGroup"
	"time"
)

type User struct {
	Id        int64     `gorm:"column:id;type:int UNSIGNED;primaryKey;not null;" json:"id"`
	Tel       string    `gorm:"column:tel;type:char(11);not null;" json:"tel"`
	Passwd    string    `gorm:"column:passwd;type:char(32);default:NULL;" json:"passwd"`
	DeletedAt time.Time `gorm:"column:deleted_at;type:datetime;default:CURRENT_TIMESTAMP;" json:"deleted_at"`
}

func (u *User) TableName() string {
	return "user"
}
func (u *User) GetUserInfoByTel(tel string) error {
	return oneGroup.DB.Where("tel = ?", tel).Limit(1).Find(&u).Error
}
